package com.xyzq.cgate.admin.wrapper;

import com.xyzq.cgate.common.entity.Rule;
import com.xyzq.cgate.common.enums.MatchModeEnum;
import com.xyzq.cgate.common.enums.OpenStateEnum;

/**
 * @Description:
 * @author chenchen
 * @date 2019/6/10 15:18
 */
public class RuleWrapper {

    public final static Rule wrapper(Rule rule) {
        if(OpenStateEnum.OPEN.getCode().equals(rule.getEnabled())) {
            rule.setEnabledContent(OpenStateEnum.OPEN.isOpen());
        } else {
            rule.setEnabledContent(OpenStateEnum.CLOSE.isOpen());
        }
        return rule;
    }
}
